(in-package :cl-daisyui)


;;; https://daisyui.com/components/accordion/
(defmacro accordion/input (name &optional checked)
  `(spinneret:with-html
     (if ,checked
         (:input :type "radio" :name ,name :checked "checked")
         (:input :type "radio" :name ,name))))

(defmacro accordion/label (class label)
  `(spinneret:with-html
     (:div :class ,class ,label)))

(defmacro accordion/item (class input-node label-node &rest content-nodes)
  `(spinneret:with-html
     (:div :class ,class
           ,input-node
           ,label-node
           (:div :class "collapse-content"
                 ,@content-nodes))))

(defmacro accordion (class &rest item-nodes)
  `(spinneret:with-html
     (if ,class
         (:div :class ,class
               ,@item-nodes)
         (:div ,@item-nodes))))


;;; https://daisyui.com/components/avatar/
(defmacro avatar (class shape-class content-element)
  "Note that the `class` may be prose free, and `class` could be set to 'avatar not-prose'.
https://github.com/tailwindlabs/tailwindcss/discussions/11773"
  `(spinneret:with-html
     (:div :class ,class
           (:div :class ,shape-class
                 ,content-element))))


;;; https://daisyui.com/components/badge/
(defmacro badge (class content)
  `(spinneret:with-html
     (:div :class ,class ,content)))


;;; https://daisyui.com/components/card/
(defmacro card (class first-node second-node)
  `(spinneret:with-html
     (:div :class ,class ,first-node ,second-node)))


;;; https://daisyui.com/components/carousel/
(defmacro carousel-item (class item &rest attrs)
  `(spinneret:with-html
     (:div :class ,class ,@attrs ,item)))

(defmacro carousel-item/id (class id item &rest attrs)
  `(spinneret:with-html
     (:div :class ,class :id ,id ,item ,@attrs)))

(defmacro carousel (class &rest items)
  `(spinneret:with-html
     (:div :class ,class
           ,@items)))

;; https://daisyui.com/components/kbd/
(defmacro kbd (class &rest attrs-and-key)
  `(spinneret:with-html
     (:div :class ,class
           ,@attrs-and-key)))
